<template>
	<view>
		<live-pusher id="livepusher" :url="url" mode="FHD" beauty="5" whiteness="5"></live-pusher>
			<button @click="startLive">开始推流（开始直播）</button>
			<button @click="stopLive" >结束推流</button>
			
	</view>
</template>
	

<script>
	
	export default {
		data() {
			return {
				url:'http://qiniu.yixizhibo.com/20200325/5e7ad123d15eb.mp4',
				enableCamera: false,
				context: null
			}
		},
		onReady (){
			this.context = uni.createLivePusherContext('livepusher', this)	
		},
		methods: {
			EnableCamera() {
						this.enableCamera = true;
					},
					startLive() {
						this.context.start({
							success: a => {
								console.log('livePusher.start:' + JSON.stringify(a));
							}
						});
					},
					stopLive() {
						this.context.stop({
							success: a => {
								console.log(JSON.stringify(a));
							}
						});
					}
		}
	}
</script>

<style>

</style>
